package org.dromara.tearoom.domain.bo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.tearoom.domain.TerGroupBuy;

import java.util.Date;

/**
 * 团购核销业务对象 ter_group_buy
 *
 * @author ckj
 * @date 2025-05-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = TerGroupBuy.class, reverseConvertGenerate = false)
public class TerGroupBuyBo extends BaseEntity {

    /**
     * ID
     */
    @NotNull(message = "ID不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 关联ID
     */
    @NotNull(message = "关联ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long relateId;

    /**
     * 关联类型
     */
    @NotNull(message = "关联类型不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer relateType;

    /**
     * 名称
     */
    @NotBlank(message = "名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String name;

    /**
     * 券码
     */
    private String code;

    /**
     * 加密券码
     */
    private String encryptedCode;

    /**
     * 用户编号
     */
    @NotNull(message = "用户编号不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long userId;

    /**
     * 商户ID
     */
    private String accountId;

    /**
     * 券的状态
     */
    @NotNull(message = "券的状态不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer status;

    /**
     * 原价,单位分
     */
    private Integer originalAmount;

    /**
     * 实付金额,单位分
     */
    private Integer payAmount;

    /**
     * 券码有效期（开始时间）
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    /**
     * 券码有效期（结束时间）
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date expireTime;

    /**
     * 使用时间
     */
    private Date useTime;

    /**
     * 团购类型
     */
    @NotNull(message = "团购类型不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer type;

    /**
     * 平台类型1-自营2-美团3-抖音4-快手
     */
    private Integer plateType;

    /**
     * 平台订单ID
     */
    private String plateOrderId;

    /**
     * 备注
     */
    private String remark;




}
